<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page import="java.util.Locale" %>

<fmt:bundle basename="StripesResources" /> 
<fmt:message key='menu.play' var="play" />
<s:layout-render name="layout.jsp" nadpis="${play}">

    <s:layout-component name="telo">
        <s:useActionBean beanclass="cz.muni.fi.pa165.hauntedhouses.web.PlayActionBean" var="actionBean"/>
            <img style="float: left; margin: 20px;" src="../images/scared-to-death.png" width="50%" height="50%" alt="scared-to-death"/>
            <br />    
            <h3><fmt:message key="play.ghost"/><i>${actionBean.ghost.name}</i><font style="color: green"> +${actionBean.diffExp} XP</font></h3>
            <fmt:message key="play.frightened"/><br />
            <c:choose>
                <c:when test="${actionBean.human.psyche<=0}">
                    <h3><fmt:message key="play.human1"/><i>${actionBean.human.name}</i><font style="color: red"> <fmt:message key="play.died"/></font></h3>
                    </c:when>
                    <c:otherwise>
                    <h3><fmt:message key="play.human2"/><i>${actionBean.human.name}</i><font style="color: red"> ${actionBean.diffPsyche} <fmt:message key="play.psyche2"/></font></h3>
                    </c:otherwise>
                </c:choose>

            <s:form beanclass="cz.muni.fi.pa165.hauntedhouses.web.PlayActionBean">
                <s:hidden name="ghost.id" />
                <c:choose>
                    <c:when test="${actionBean.diffLvl>0}">

                        <br />
                        <h3><font style="color: green"><fmt:message key="play.levelreached"/> ${actionBean.ghost.lvl}</font></h3>
                                
                        <br />
                    </c:when>
                        </c:choose>
                        <c:choose>
                        <c:when test="${(actionBean.diffLvl>0)&&((actionBean.ghost.lvl==3) || (actionBean.ghost.lvl==6))}">
                            <font style="color: green"><fmt:message key="play.newability"/></font><br />
                                   <s:link beanclass="cz.muni.fi.pa165.hauntedhouses.web.GhostsActionBean" event="edit">
                                       <s:param name="ghost.id" value="${actionBean.ghost.id}"/>
                                      <fmt:message key="play.selectability2"/> </s:link><br />
                                </c:when>
                </c:choose>
                <br /><br />

                <s:submit style="width: 210px;height: 30px" name="play">
                    <fmt:message key="play.playagain"/>
                </s:submit>
            </s:form>
    </s:layout-component>
</s:layout-render>
